package com.cyj.springbootservice.api.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.cyj.springbootservice.api.constant.DateConstants;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @description:
 * @Author C_Y_J
 * @create 2021/10/7 11:48
 **/
@Data
@Accessors(chain = true)
public class AerialLatitudeAndLongitude implements Serializable {
    private static final long serialVersionUID = -7942882309019421476L;

    /**
     * 经纬度集合id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.ID_WORKER)
    private Long id;

    /**
     * 航拍id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long aerialId;

    /**
     * 经度
     */
    @NotBlank(message = "经度不能为空")
    private Double longitude;

    /**
     * 纬度
     */
    @NotBlank(message = "纬度不能为空")
    private Double latitude;

    /**
     * 标记位
     */
    @NotBlank(message = "标记位不能为空")
    private Integer flagBit;

    /**
     * 是否删除 0未删除,1删除
     */
    @TableLogic
    private Boolean isDeleted;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = DateConstants.PATTERN_DATETIME)
    @DateTimeFormat(pattern = DateConstants.PATTERN_DATETIME)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = DateConstants.PATTERN_DATETIME)
    @DateTimeFormat(pattern = DateConstants.PATTERN_DATETIME)
    private LocalDateTime updateTime;

}
